// Copyright (C) 2010  Joan Puigcerver Perez, <joapuipe@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

#ifndef __LINK_HPP__
#define __LINK_HPP__

#include <Work.hpp>

class Movie;
class Person;

/**
 * \class Link
 *
 * Used to represent a link (a.k.a edge or connection) between a person and a movie.
 *
 */
class Link {
private:
  const Movie  * _movie;
  const Person * _person;
  const Work _work;
  
public:
  /**
   * Constructor that creates a link from a given movie, person and work.
   * It is the duty of the programer to add the link to the movie and person list.
   */
  Link(const Movie * movie, const Person * person, const Work work);
  
  /**
   * Method that obtains the movie which the link is connecting to a person.
   */
  const Movie * movie(void) const;

  /**
   * Method that obtains the person who the link is connecting to a movie.
   */
  const Person * person(void) const;

  /**
   * Method that obtains the work done by the person in the movie.
   */
  Work work(void) const;
};

#endif
